#pragma once
#include <string>
#include <WinSock2.h>
#include <iostream>
const int BUFFERSIZE = 512;

class ClientSocket
{
public:
	ClientSocket(char *host, int portno): m_host(host), m_port(portno) {}
	~ClientSocket();
	bool initialize();
	void closeConnection();
	void sendData(std::string commandString);
	std::string receiveData();
	void getErrors();
private:
	char *m_host;
	int m_port;
	char m_buffer[BUFFERSIZE];
	struct sockaddr_in serveraddr;
	SOCKET m_sock;
	std::string m_response;
};
